﻿
var x=document.MapDot.xx.value;
var y=document.MapDot.yy.value;
var text=document.MapDot.html.value;

google.maps.event.addDomListener(window, 'load', function() {
	

	
	var map = new google.maps.Map(document.getElementById('map'), {
	  zoom: 16,
	  center: new google.maps.LatLng(x,y),
	  mapTypeId: google.maps.MapTypeId.ROADMAP
	});

	var infoWindow = new google.maps.InfoWindow;

	var onMarkerClick = function() {
		var marker = this;
		var latLng = marker.getPosition();
		infoWindow.setContent(text);
		infoWindow.open(map, marker);
	};
	
	google.maps.event.addListener(map, 'click', function() {
	  infoWindow.close();
	});

	var marker1 = new google.maps.Marker({
	  map: map,
	  title: 'приемная комиссия',
	  position: new google.maps.LatLng(x,y)
	});

	google.maps.event.addListener(marker1, 'click', onMarkerClick);

  });
  

